import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBApplication.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBImageStyle/YBImageStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBTextStyle/YBTextStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/YBLoginModule/YBLoginMainPage/YBLoginProvider/YBLoginSelectEventBus.dart';


class YBLoginYinSiPage extends StatefulWidget {
  @override
  _YBLoginYinSiPageState createState() => _YBLoginYinSiPageState();
}

class _YBLoginYinSiPageState extends State<YBLoginYinSiPage> {


  bool selectYisi = false;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();

  }

  @override
  Widget build(BuildContext context) {

    return Container(
      child: Row(
        children: [
          Container(
            child: InkWell(
              child: selectYisi?Image.asset(YBImageStyle.getImagePath("login_selected"),width: 20,height: 20,):Image.asset(YBImageStyle.getImagePath("login_default"),width: 20,height: 20,),
              onTap: () async {
                setState(() {
                  selectYisi = !selectYisi;
                  selectEventBus.fire(YBLoginSelectEventBus(selectYisi));
                });
              },
            ),
          ),
          Container(
            width: 5,
          ),
          Container(
            child:RichText(
              text:TextSpan(
                style: YBTextStyle.homeSmallSubText,
                children:<InlineSpan>[
                  TextSpan(
                    text: "勾选即代表您同意",
                    style: YBTextStyle.logincolor383A3D13Light,
                  ),
                  TextSpan(
                      text: '《服务条款》',
                      style: YBTextStyle.login2D69E013light,
                      recognizer: TapGestureRecognizer()..onTap = (){
                        YBApplication.router.navigateTo(context, '/mine/mineFuWuTiaoKuanPage');
                      }
                  ),
                  TextSpan(
                    text: '及',
                    style: YBTextStyle.logincolor383A3D13Light,
                  ),
                  TextSpan(
                      text: '《隐私政策》',
                      style: YBTextStyle.login2D69E013light,
                      recognizer: TapGestureRecognizer()..onTap = (){
                        YBApplication.router.navigateTo(context, '/mine/mineYinSiZhengCePage');
                      }
                  ),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}
